<template>
	<view class="viewbox auto content" :style="{'--color':color}" v-if="pageData">
		<view class="rows">
			<view class="row a-center j-sb">
				<view class="d-flex a-center">
					<image :src="$imgUrls(pageData.member_info.v_headimg)" mode="aspectFill" class="userImg"></image>
					<view class="d-flex f-column white">
						<text class="size28">{{pageData.member_info.v_name}}</text>
						<text class="h6 m-top4">{{pageData.member_info.v_tel}}</text>
					</view>
				</view>
				<view class="d-flex f-column a-center white" @click="toUrl(`ranking`)">
					<view class="iconfont icon-paihangbang  size36"></view>
					<text class="h7">排行榜</text>
				</view>
				
			</view>
			<view class="row a-center m-top30">
				<view class="flex-1 d-flex j-sa" @click.stop="toUrl(`index`)">
					<view class="d-flex f-column a-center white">
						<text class="size30 bold">{{pageData.progress}}</text>
						<text class="h6 m-top10">进行中</text>
					</view>
					<view class="d-flex f-column a-center white" @click.stop="toUrl(`successful`)">
						<text class="size30 bold">{{pageData.success}}</text>
						<text class="h6 m-top10">已成功</text>
					</view>
					<view class="d-flex f-column a-center white" @click.stop="toUrl(`stock`)">
						<text class="size30 bold">{{pageData.income}}</text>
						<text class="h6 m-top10">可提现</text>
					</view>
				</view>
				<view class="withdraw a-self-end" @click="toUrl(`stock`)">提现</view>
			</view>
		</view>
	
	</view>
</template>

<script>
	import {mapState} from 'vuex';
	export default {
		name:'userInfo',
		data() {
			return {
				pageData:'',
			}
		},
		created() {
			this.getSaleBlock();
		},
		methods: {
			getSaleBlock(){
				this.$http.get({
					url:'/BlockApi/getSaleBlock',
				}).then(res=>{
					if(res.code != 200) return this.$Toast(res.msg);
					const result = res.data;
					this.pageData = result;
					this.$emit('userInfo',result.member_info)
				})
			},
		},
		computed:{
			...mapState(['color'])
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		margin-top: 24rpx;
		height: 300rpx;
		background-image: url('http://sraimgcdn2.mogoie.com/Uploads/xiangqing/userbg.png');
		background-repeat: no-repeat;
		background-size: cover;
		background-position: bottom;
		border-radius: 20rpx;
		padding: 30rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.userImg {
		width: 88rpx;
		height: 88rpx;
		border-radius: 50%;
		margin-right: 20rpx;
	}
	.withdraw{
		background-color: var(--color);
		width:120rpx;
		height: 50rpx;
		color:#fff;
		font-size:24rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 6rpx;
	}
</style>
